New upstream version 0.1.28
authorMatteo F. Vescovi <mfv@debian.org>
Fri, 2 Jun 2017 12:15:16 +0000 (14:15 +0200)
committerMatteo F. Vescovi <mfv@debian.org>
Fri, 2 Jun 2017 12:15:16 +0000 (14:15 +0200)
AUTHORS
INSTALL
Makefile.in
NEWS
README
babl/babl-version.h
configure
configure.ac
extensions/CIE.c
extensions/cairo.c

diff --git a/AUTHORS b/AUTHORS
index 01b5dbf7d06420fabec36839dd263ab98802b9a5..04ad3ae86c96de55f2db1084b5231e9e993da750 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -74,4 +74,6 @@
         <dd>Portability, Stability and more</dd>
   <dt>Massimo Valentini</dt>
         <dd>stability fixes</dd>
+  <dt>Ell</dt>
+        <dd>fast paths</dd>
 </dl>
diff --git a/INSTALL b/INSTALL
index 24a3c8be60c29284cdc6ccdae92e9f9680936d94..d011898e14dfae088a10272e1bac946c995ed249 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
 
-babl 0.1.26
+babl 0.1.28
 
     Dynamic; any to any, pixel format conversion library.
 
@@ -12,10 +12,10 @@ From a released version the following is the expected method of
 installation (or a variation on this theme):
 
      ------------------------------------------------------------
-     foo$ wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.26.tar.bz2
-     foo$ tar jxf babl-0.1.26.tar.gz
-     foo$ cd babl-0.1.26
-     foo/babl-0.1.26$ ./configure && make && sudo make install
+     foo$ wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.28.tar.bz2
+     foo$ tar jxf babl-0.1.28.tar.gz
+     foo$ cd babl-0.1.28
+     foo/babl-0.1.28$ ./configure && make && sudo make install
      ------------------------------------------------------------
 
 
index 86bde5639662d6dbc1643db9898ac6fb5cf2f4ab..98b34edf45ee178bc20549181bedaf5dd736631a 100644 (file)
@@ -195,7 +195,7 @@ DIST_SUBDIRS = babl extensions tests tools docs
 am__DIST_COMMON = $(srcdir)/INSTALL.in $(srcdir)/Makefile.in \
        $(srcdir)/babl.pc.in $(srcdir)/config.h.in AUTHORS COPYING \
        INSTALL NEWS README TODO compile config.guess config.sub \
-       install-sh ltmain.sh missing
+       depcomp install-sh ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
diff --git a/NEWS b/NEWS
index 64f2a2284ca91ff06b6e123d5d27ac062cfef48d..b91eb367edb37953bc09974f74c2431543801c31 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@ the news section both in the README and the webpage.
                                                                           -->
 
 
+2017-05-30 babl-0.1.28                                              </dt><dd>
+Fast paths for Lav <-> Lch, release triggered by pending GIMP release.
+                                                                    </dd><dt>
 2017-05-09 babl-0.1.26                                              </dt><dd>
 Build and install HCY color space, platform independences fixes to fish cache.
                                                                     </dd><dt>
diff --git a/README b/README
index c70899b97443d65d6620fc3e309ace711e0174f7..6be3cd6a987408f854415ab44aa34ec8ad5dff28 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Babl-0.1.26
+Babl-0.1.28
 
 Contents
 
@@ -59,6 +59,9 @@ babl release. If there are significant improvements to babl when a GEGL
 release is done a babl release is most often put out just prior to the
 GEGL release.
 
+2017-05-30 babl-0.1.28
+    Fast paths for Lav <-> Lch, release triggered by pending GIMP
+    release.
 2017-05-09 babl-0.1.26
     Build and install HCY color space, platform independences fixes to
     fish cache.
@@ -2144,5 +2147,7 @@ Jon Nordby
     Portability, Stability and more
 Massimo Valentini
     stability fixes
+Ell
+    fast paths
 
-/babl-0.1.26
+/babl-0.1.28
index c4187307a6ca7e5a0e867ccd7734e640b7e542c4..5f1a1f772ae70737723b361f153ea4fdcdc95c94 100644 (file)
@@ -34,7 +34,7 @@
 
 #define BABL_MAJOR_VERSION 0
 #define BABL_MINOR_VERSION 1
-#define BABL_MICRO_VERSION 26
+#define BABL_MICRO_VERSION 28
 
 /** Get the version information on the babl library */
 void   babl_get_version (int *major,
index 82c7e4873a98735c19ea6a44737d9f284a17e9e5..ee1844470bea663866c5c760d25889b99effc847 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for babl 0.1.26.
+# Generated by GNU Autoconf 2.69 for babl 0.1.28.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='babl'
 PACKAGE_TARNAME='babl'
-PACKAGE_VERSION='0.1.26'
-PACKAGE_STRING='babl 0.1.26'
+PACKAGE_VERSION='0.1.28'
+PACKAGE_STRING='babl 0.1.28'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1380,7 +1380,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures babl 0.1.26 to adapt to many kinds of systems.
+\`configure' configures babl 0.1.28 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1452,7 +1452,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of babl 0.1.26:";;
+     short | recursive ) echo "Configuration of babl 0.1.28:";;
    esac
   cat <<\_ACEOF
 
@@ -1572,7 +1572,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-babl configure 0.1.26
+babl configure 0.1.28
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1937,7 +1937,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by babl $as_me 0.1.26, which was
+It was created by babl $as_me 0.1.28, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2293,11 +2293,11 @@ ac_config_headers="$ac_config_headers config.h"
 
 BABL_MAJOR_VERSION=0
 BABL_MINOR_VERSION=1
-BABL_MICRO_VERSION=26
+BABL_MICRO_VERSION=28
 BABL_INTERFACE_AGE=1
-BABL_BINARY_AGE=126
-BABL_VERSION=0.1.26
-BABL_REAL_VERSION=0.1.26
+BABL_BINARY_AGE=128
+BABL_VERSION=0.1.28
+BABL_REAL_VERSION=0.1.28
 BABL_API_VERSION=0.1
 
 
@@ -2332,7 +2332,7 @@ fi
 
 
 
-BABL_LIBRARY_VERSION="125:1:125"
+BABL_LIBRARY_VERSION="127:1:127"
 BABL_CURRENT_MINUS_AGE=0
 
 
@@ -2964,7 +2964,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='babl'
- VERSION='0.1.26'
+ VERSION='0.1.28'
 
 
 # Some tools Automake needs.
@@ -14854,7 +14854,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by babl $as_me 0.1.26, which was
+This file was extended by babl $as_me 0.1.28, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -14920,7 +14920,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-babl config.status 0.1.26
+babl config.status 0.1.28
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index ff256d2efe1c719437dfbdbecd3ae9ee1a01573b..1f44e53a881398d7a556b8534fd1231f9f559776 100644 (file)
@@ -14,7 +14,7 @@ AC_PREREQ(2.54)
 
 m4_define([babl_major_version], [0])
 m4_define([babl_minor_version], [1])
-m4_define([babl_micro_version], [26])
+m4_define([babl_micro_version], [28])
 m4_define([babl_real_version],
           [babl_major_version.babl_minor_version.babl_micro_version])
 m4_define([babl_version], [babl_real_version])
index a6c84399d1ff96e2e3f6f40f0ba696be90f61392..040c03c4be15d90582db65a8b84505d87b8b252b 100644 (file)
@@ -808,6 +808,126 @@ Labaf_to_rgbaf (float *src,
   return samples;
 }
 
+static long
+Labf_to_Lchabf (float *src,
+                float *dst,
+                long   samples)
+{
+  long n = samples;
+
+  while (n--)
+    {
+      float L = src[0];
+      float A = src[1];
+      float B = src[2];
+
+      float C = sqrtf (A * A + B * B);
+      float H = atan2f (B, A) * DEGREES_PER_RADIAN;
+
+      // Keep H within the range 0-360
+      if (H < 0.0f)
+        H += 360.0f;
+
+      dst[0] = L;
+      dst[1] = C;
+      dst[2] = H;
+
+      src += 3;
+      dst += 3;
+    }
+
+  return samples;
+}
+
+static long
+Lchabf_to_Labf (float *src,
+                float *dst,
+                long   samples)
+{
+  long n = samples;
+
+  while (n--)
+    {
+      float L = src[0];
+      float C = src[1];
+      float H = src[2];
+
+      float A = C * cosf (H * RADIANS_PER_DEGREE);
+      float B = C * sinf (H * RADIANS_PER_DEGREE);
+
+      dst[0] = L;
+      dst[1] = A;
+      dst[2] = B;
+
+      src += 3;
+      dst += 3;
+    }
+
+  return samples;
+}
+
+static long
+Labaf_to_Lchabaf (float *src,
+                  float *dst,
+                  long   samples)
+{
+  long n = samples;
+
+  while (n--)
+    {
+      float L = src[0];
+      float A = src[1];
+      float B = src[2];
+      float a = src[3];
+
+      float C = sqrtf (A * A + B * B);
+      float H = atan2f (B, A) * DEGREES_PER_RADIAN;
+
+      // Keep H within the range 0-360
+      if (H < 0.0f)
+        H += 360.0f;
+
+      dst[0] = L;
+      dst[1] = C;
+      dst[2] = H;
+      dst[3] = a;
+
+      src += 4;
+      dst += 4;
+    }
+
+  return samples;
+}
+
+static long
+Lchabaf_to_Labaf (float *src,
+                  float *dst,
+                  long   samples)
+{
+  long n = samples;
+
+  while (n--)
+    {
+      float L = src[0];
+      float C = src[1];
+      float H = src[2];
+      float a = src[3];
+
+      float A = C * cosf (H * RADIANS_PER_DEGREE);
+      float B = C * sinf (H * RADIANS_PER_DEGREE);
+
+      dst[0] = L;
+      dst[1] = A;
+      dst[2] = B;
+      dst[3] = a;
+
+      src += 4;
+      dst += 4;
+    }
+
+  return samples;
+}
+
 static void
 conversions (void)
 {
@@ -889,6 +1009,30 @@ conversions (void)
     "linear", lchaba_to_rgba,
     NULL
   );
+  babl_conversion_new (
+    babl_format ("CIE Lab float"),
+    babl_format ("CIE LCH(ab) float"),
+    "linear", Labf_to_Lchabf,
+    NULL
+  );
+  babl_conversion_new (
+    babl_format ("CIE LCH(ab) float"),
+    babl_format ("CIE Lab float"),
+    "linear", Lchabf_to_Labf,
+    NULL
+  );
+  babl_conversion_new (
+    babl_format ("CIE Lab alpha float"),
+    babl_format ("CIE LCH(ab) alpha float"),
+    "linear", Labaf_to_Lchabaf,
+    NULL
+  );
+  babl_conversion_new (
+    babl_format ("CIE LCH(ab) alpha float"),
+    babl_format ("CIE Lab alpha float"),
+    "linear", Lchabaf_to_Labaf,
+    NULL
+  );
   /*babl_conversion_new (
     babl_model ("RGBA"),
     babl_model ("CIE XYZ"),
index 5569ab693b980c9141ecdb8d2ee16cee95c926b4..60662587dbd3dc41cacde5637af7d41feaaa6235 100644 (file)
@@ -104,6 +104,43 @@ conv_rgbA8_premul_cairo32_le (unsigned char *src, unsigned char *dst, long sampl
 }
 #endif
 
+static long conv_cairo32_rgbA8_premul_le (unsigned char *src, unsigned char *dst, long samples)
+{
+  long n = samples;
+  while (n--)
+    {
+      unsigned char blue   = *src++;
+      unsigned char green  = *src++;
+      unsigned char red    = *src++;
+      unsigned char alpha  = *src++;
+
+      *dst++ = red;
+      *dst++ = green;
+      *dst++ = blue;
+      *dst++ = alpha;
+    }
+  return samples;
+}
+
+
+static long conv_cairo32_rgbAF_premul_le (unsigned char *src, unsigned char *dst_char, long samples)
+{
+  long n = samples;
+  float *dst = (void*)dst_char;
+  while (n--)
+    {
+      unsigned char blue   = *src++;
+      unsigned char green  = *src++;
+      unsigned char red    = *src++;
+      unsigned char alpha  = *src++;
+
+      *dst++ = red / 255.0;
+      *dst++ = green / 255.0;
+      *dst++ = blue / 255.0;
+      *dst++ = alpha / 255.0;
+    }
+  return samples;
+}
 
 static inline long
 conv_rgbA8_cairo32_le (unsigned char *src, unsigned char *dst, long samples)
@@ -359,6 +396,13 @@ init (void)
         babl_component ("PAD"),
         NULL
       );
+
+      babl_conversion_new (f32, babl_format ("R'aG'aB'aA float"), "linear", 
+                           conv_cairo32_rgbAF_premul_le, NULL);
+
+      babl_conversion_new (f32, babl_format ("R'aG'aB'aA u8"), "linear", 
+                           conv_cairo32_rgbA8_premul_le, NULL);
+
       babl_conversion_new (babl_format ("R'aG'aB'aA u8"), f32, "linear", 
                            conv_rgbA8_premul_cairo32_le, NULL);